package T6_18.T6_18_4;

public class MyThread extends Thread{
    int x = 5;
    @Override
    synchronized public void run() {
        System.out.println("这是一条继承thread的A线程");


            try {
                Thread.sleep(1000);
            }catch (InterruptedException e){
                e.printStackTrace();
            }

            for (int x = 0; x < 5; x++) {	// 循环5次
                if (this.x > 0) {
                    System.out.println("x = " + this.x --);
                }
            }



    }
}
